<T:ViewBase x:Class="WPFExcelReport.TQPMERKM"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    Background="White"  
                    FontSize="18"
                    Name="TV"
                    Loaded="Window_Loaded"
     >
    <T:ViewBase.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:NOTConverter  x:Key="not"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:Divideby100 x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
    </T:ViewBase.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" >
            <WrapPanel  Grid.Row="0" Margin="10,10,0,0" >
                <Grid Margin="10,0,0,0"  >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button   Click="NewCommand" Height="20" Margin="5,0,0,0" Width="20" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0"  >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button  Click="EditCommand" Width="16" Height="16">
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Edit.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0"  >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button Click="DeleteCommand" Height="20" Margin="5,0,0,0" Width="20" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Remove.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0"  >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button    Click="CopyCommand" Height="20" Margin="5,0,0,0" Width="20" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/copy.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0" Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button   Click="SaveCommand" Height="20" Margin="5,0,0,0" Width="20" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Save.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" FontSize="18" Text="{Binding Source={Localization:Translate Word=新项目:}}"></TextBlock>
                    <ex:TXT72    Grid.Column="1" MaxLength="4" CharacterCasing="Upper" FontSize="18" Text="{Binding ART}" Width="100" />
                </Grid>
            </WrapPanel>
            <WrapPanel  Margin="10,10,0,0">
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" FontSize="18" Text="{Binding Source={Localization:Translate Word=项目:}}"></TextBlock>
                    <TextBlock   Grid.Column="1" FontSize="18" Text="{Binding QPMMERKM, Source={StaticResource vwMaster}}" Width="80" />
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=执行标准:}}"></TextBlock>
                    <TextBlock    Grid.Column="1"  
                                  Text="{Binding QPMNORM, Source={StaticResource vwMaster}}" 
                                  Width="100" />
                    <SD:K0477   Grid.Column="2"   
                                       KEY="{Binding NORM,ElementName=TV}" 
                                       Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}" />
                </Grid>
            </WrapPanel>
            <WrapPanel  Margin="10,10,0,0">
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0"   Text="{Binding Source={Localization:Translate Word=简述:}}"></TextBlock>
                    <ex:TXT72 Grid.Column="1"  MaxLength="20" IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"  
                              Text="{Binding QPMKURZB, Source={StaticResource vwMaster},Converter={StaticResource gb2312}}" Width="200" />
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0"   Text="{Binding Source={Localization:Translate Word=计算公式:}}"></TextBlock>
                    <ex:TXT72 Grid.Column="1"  MaxLength="50" IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"  
                              Text="{Binding QPMBEZ, Source={StaticResource vwMaster},Converter={StaticResource gb2312}}" Width="400" />
                    <me:TSQP12 KEY="{Binding QTM,ElementName=TV}"/>
                </Grid>
             
            </WrapPanel>
            <WrapPanel  Margin="10,10,0,0">
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=数值型:}}"></TextBlock>
                    <ex:TXT72  Grid.Column="1"  MaxLength="1"
                                        Text="{Binding QPMNUMKZ, Source={StaticResource vwMaster}}" 
                                        IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                                        Width="30" />
                    
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=目标:}}"></TextBlock>
                    <ex:NumericBox  Grid.Column="1"  
                                        Text="{Binding QPMVERS, Source={StaticResource vwMaster}, Converter={StaticResource d1000}}" 
                                        IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                                        Width="60" />
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=数值范围:}}"></TextBlock>
                    <ex:NumericBox DecimalPlaces="2" Grid.Column="1"  
                                       Text="{Binding QPMWERTV, Source={StaticResource vwMaster}, Converter={StaticResource d1000}}" 
                                       IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                                       Width="60" />
                    <ex:NumericBox  DecimalPlaces="2" Grid.Column="2" 
                                            Text="{Binding QPMWERTB, Source={StaticResource vwMaster}, Converter={StaticResource d1000}}" 
                                            IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                                            Width="60" />
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=单位:}}"></TextBlock>
                    <TextBlock   Grid.Column="1"  Text="{Binding QPMMEEH, Source={StaticResource vwMaster}}" Width="60" />
                    <SD:TSSD0181   Grid.Column="2" Name="c181"  
                                       KEY="{Binding DENUM,ElementName=TV}" 
                                       Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}" />

                </Grid>
            </WrapPanel>
            <WrapPanel  Margin="10,10,0,0">
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=等级范围:}}"></TextBlock>
                    <ex:TXT72 Grid.Column="1"  MaxLength="10" CharacterCasing="Upper" 
                              IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"  
                              Text="{Binding QPMAWERTV, Source={StaticResource vwMaster},Converter={StaticResource gb2312}}" Width="100" />
                    <ex:TXT72 Grid.Column="2"  MaxLength="10" CharacterCasing="Upper" 
                              IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"  
                              Text="{Binding QPMAWERTB, Source={StaticResource vwMaster},Converter={StaticResource gb2312}}" Width="100" />

                </Grid> 
            </WrapPanel>
        </StackPanel>
    </Grid>
</T:ViewBase>
